package a01;
/**
 * @author Sven Eric Panitz
 */
import java.io.Serializable;


public class Highscore implements Comparable<Highscore>, Serializable{
	private static final long serialVersionUID = 1L;
	int points = 0;
	String name = "";

	public Highscore() {
		this("", 0);
	}
	
	public Highscore(String name, int score) {
		this.points = score;
		this.name = name;
	}

	public void setName(String playerName) {
		this.name = playerName;
	}
	
	public String getName() {
		return this.name;
	}
	
	public int getScore() {
		return this.points;
	}
	
	@Override
	public int compareTo(Highscore highscore) {
		return this.getScore() - highscore.getScore();
	}

}
